package com.yami.shop.bean.event;

import com.yami.shop.bean.enums.EsOperationType;
import com.yami.shop.bean.vo.EsMysteryBoxUpdateVO;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * es盲盒商品事件， 获取商品信息
 * @author wxf
 * @date 2023/6/2 17:32
 */
@Data
@AllArgsConstructor
public class EsMysteryBoxUpdateEvent {

    public EsMysteryBoxUpdateEvent(List<EsMysteryBoxUpdateVO> boxList, EsOperationType esOperationType) {
        this.boxList = boxList;
        this.esOperationType = esOperationType;
    }

    public EsMysteryBoxUpdateEvent(Long id, List<Long> ids, EsOperationType esOperationType) {
        this.id = id;
        this.ids = ids;
        this.esOperationType = esOperationType;
    }
    /**
     * 单条数据操作字段 (商品id、分类id、店铺id)
     */
    private Long id;
    /**
     *  批量操作使用字段
     */
    private List<Long> ids;
    /**
     * 更新的商品数据列表--订单更新库存及销量时使用
     */
    private List<EsMysteryBoxUpdateVO> boxList;
    /**
     * 操作类型（保存、更新、删除等）
     */
    private EsOperationType esOperationType;

}
